<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="/static/base/common/css/sapar.css"/>
    <link rel="stylesheet" href="/static/base/static/css/index_inner.css"/>
    <link rel="stylesheet" type="text/css" href="/static/webjars/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" type="text/css" href="/static/webjars/layui/css/modules/layer/default/layer.css" media="all">
    <title>居民与房屋管理-主页</title>

    <style type="text/css">
        .table-backcolor {
            background-color: #eff6fa;
        }
        /*table tr td {*/
        /*text-align: center;*/
        /*}*/
    </style>
</head>

<body>
<div id="container" >
    <div id="bd" style="width: 98%;height:100%;margin: 0 auto">
        <form class="layui-form" action="" style="margin-top: 20px;" lay-filter="Proprietor">
            <div class="layui-collapse" lay-filter="test">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">基本信息</h2>
                    <div class="layui-colla-content layui-show">
                        <table class="layui-table">
                            <tr>
                                <td width="150px">姓名</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="name"  placeholder="请输入姓名" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>性别</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="sex"  placeholder="性别" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>年龄</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="age"  placeholder="年龄" class="layui-input" disabled="">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>政治面貌</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="politicalOutlook"  placeholder="政治面貌" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>联系电话</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="tellphone"  placeholder="联系电话" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>身份证号</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="idCard"  placeholder="身份证号" class="layui-input" disabled="">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td >家庭住址</td>
                                <td >
                                    <div class="layui-inline">
                                        <input type="text" name="livein"  placeholder="家庭住址" class="layui-input" disabled="">
                                    </div>
                                    <span id="lookOnMap"></span>
                                </td>
                                </td>
                                <td>民族</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="nation"  placeholder="民族" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>就业状况</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="work"  placeholder="就业状况" class="layui-input" disabled="">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>工作行业</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="industry"  placeholder="工作行业" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>婚姻状况</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="marriage"  placeholder="婚姻状况" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>户口性质</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="nohRegister"  placeholder="户口性质" class="layui-input" disabled="">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>户籍所在地</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="hrResiter"  placeholder="户籍所在地" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>受教育程度</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="education"  placeholder="受教育程度" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>收入情况</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="income"  placeholder="收入情况" class="layui-input" disabled="">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>毕业学校</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="school"  placeholder="毕业学校" class="layui-input" disabled="">
                                    </div>
                                </td>
                                <td>所学专业</td>
                                <td>
                                    <div class="layui-inline">
                                        <input type="text" name="major"  placeholder="所学专业" class="layui-input" disabled="">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>备注</td>
                                <td colspan="3" >
                                    <input type="text" name="beizhu"  placeholder="所学专业" class="layui-input" disabled="">
                                </td>

                            </tr>
                        </table>
                    </div>
                </div>

            </div>
        </form>
    </div>
</div>

</body>
<script type="text/javascript" src="/static/webjars/layui/layui.all.js"></script>
<script type="text/javascript" src="/static/base/common/js/jquery.js"></script>
<script type="text/javascript" src="/static/base/common/js/sapar.js"></script>
<script type="text/javascript" src="/static/base/static/js/index_inner.js"></script>
<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作


    layui.use(['element','table','form'], function(){
        var element = layui.element;
        //…
        var table = layui.table;
        var form = layui.form;
        var $ = layui.$;
        var Id = GetRequest();



        var active = {
            pass: function(){ //获取选中数据
                $.post("/ajax/save/houseinfo-status",{
                    id: Id
                },function(result){
                    if(result.res === "1"){
                        console.log(result)
                    }
                });
            }
            ,refuse: function(){ //获取选中数目
                $.post("/ajax/save/houseinfo-deny",{
                    id:GetRequest()
                },function(result){
                    if(result.res === "1"){
                        console.log(result)
                    }
                });
            }

        };


        $.ajax({ //jquery跳转传输数据
            type : "POST",
            url : "/ajax/house/userInfo/seachByUserId",//跳转的controller
            dataType : "json",//返回类型
            contentType : "application/x-www-form-urlencoded; charset=utf-8",
            data : {//传输controller的键值对
                "id" : GetRequest()
            },
            success : function(house) {//成功后执行并取值

                form.val('Proprietor', {
                    "name": house.data.name  // "name": "value"
                    ,"idCard": house.data.idCard
                    ,"sex": house.data.sex
                    ,"age": house.data.age
                    ,"politicalOutlook": house.data.politicalOutlook
                    ,"tellphone": house.data.tellphone
                    ,"livein": house.data.livein
                    ,"nation": house.data.nation
                    ,"work": house.data.work
                    ,"industry": house.data.industry
                    ,"marriage": house.data.marriage
                    ,"nohRegister": house.data.nohRegister
                    ,"hrResiter": house.data.hrResiter
                    ,"education": house.data.education
                    ,"income": house.data.income+"元/月"
                    ,"school": house.data.school
                    ,"major": house.data.major
                    ,"beizhu": house.data.beizhu
                })


            },
            error : function(request) {//失败后执行
                layer.msg("数据加载失败");
            }
        });
        $("#lookOnMap").append('<a href="/house/lookPeople?id='+GetRequest() +
            '" target="_blank">地图查看</a>');

        function GetRequest() {
            var url = location.search; //获取url中"?"符后的字串
            if (url.indexOf("?") != -1) {    //判断是否有参数
                var str = url.substr(1); //从第一个字符开始 因为第0个是?号 获取所有除问号的所有符串
                strs = str.split("=");   //用等号进行分隔 （因为知道只有一个参数 所以直接用等号进分隔 如果有多个参数 要用&号分隔 再用等号进行分隔）
                return strs[1];          //直接弹出第一个参数 （如果有多个参数 还要进行循环的）
            }
        }
    });
</script>
</html>
